package org.dromara.business.domain.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.dromara.business.domain.ShoppingCart;
import org.dromara.common.json.handler.DecimalRemoveZeroSerializer;
import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;


/**
 * 购物车视图对象 shopping_cart
 *
 * @author zlj
 * @date 2024-08-10
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = ShoppingCart.class)
public class ShoppingCartVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @ExcelProperty(value = "主键")
    private Long shoppingCartId;

    /**
     * 商品名称
     */
    @ExcelProperty(value = "商品名称")
    private String name;

    /**
     * 商品图片id
     */
    @ExcelProperty(value = "商品图片id")
    private Long url;
    @ExcelProperty(value = "商品图片")
    @Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "url")
    private String urlLink;

    /**
     * 商品id
     */
    @ExcelProperty(value = "商品id")
    private Long goodsId;

    /**
     * 商品价格
     */
    @ExcelProperty(value = "商品价格")
    @JsonSerialize(using = DecimalRemoveZeroSerializer.class)
    private BigDecimal price;

    /**
     * 数量
     */
    @ExcelProperty(value = "数量")
    @JsonSerialize(using = DecimalRemoveZeroSerializer.class)
    private BigDecimal num;
    @JsonSerialize(using = DecimalRemoveZeroSerializer.class)
    private BigDecimal allPrice;

}
